unmagic quotes

November 25, 2009 · 67 views · 0 comments

unmagic quotes
taken by : Dedric Mauriac
on Woodbridge (7, 4, 99)

About

I ran into a problem today with encoding strings for SQL. Upon looking into the problem, I realized an oddity from a past problem was very much related. It turns out that PHP, by default, escapes quotes. It was originally included with PHP to prevent SQL injection attacks. The problem however, is that like-minded developers who already take measures against this end up having data appear in the database as if someone had double- escaped the strings during an insert/update. I'm at a cross roads determining if I should detect if this is on, or to turn it off and assume that it will always be off. From Dedric Mauriac via bloghud.com